package com.vay.de.dang.online.view;

import android.content.Context;
import android.webkit.WebView;

import com.vay.de.dang.online.VnApp;
import com.vay.de.dang.online.util.WebViewUtil;
import com.vay.de.dang.online.util.VnDefine;

import com.vay.de.dang.online.R;

public class DialogInstructions extends DialogBottom {

    private WebView webView;
    private DialogCallback mCallback;

    public DialogInstructions(Context context) {
        super(context);
        setContentView(R.layout.dialog_home_permission);

        webView = findViewById(R.id.web_view);
        WebViewUtil.setting(webView);
        webView.loadUrl(VnDefine.HomePermission);
        webView.getLayoutParams().height = (int) (VnApp.getScreenHeight() * 0.75f);

        findViewById(R.id.bnt_cancel).setOnClickListener(view -> {
            dismiss();
        });

        findViewById(R.id.bnt_agree).setOnClickListener(view -> {
            dismiss();
            mCallback.onConfirm();
        });
    }

    public void showPermission(DialogCallback callback) {
        mCallback = callback;
        show();
    }

}
